package architect;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

import java.util.concurrent.TimeUnit;

/**
 * 服务消费者启动类
 *
 * @author guanxin
 * @date 2018/4/18 10:56
 */

@EnableCircuitBreaker
@EnableFeignClients
@EnableEurekaClient
@SpringBootApplication
public class ServiceConsumerApp implements CommandLineRunner {

    public static void main( String[] args ) throws InterruptedException {
        SpringApplication.run(ServiceConsumerApp.class, args);
        TimeUnit.MINUTES.sleep(60);
        System.err.println("Service Consumer=============>>>>>>>>>>>>>服务关闭");
    }

    @Override
    public void run(String... args) throws Exception {
        System.out.println("Service Consumer=============>>>>>>>>>>>>>启动完毕");
    }
}
